package com.zhaopin.file;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;

/**
 * @author Administrator
 * @create 2019-06-11 13:50
 */
public class ReadFile {


    public static void main(String[] args) throws IOException {

        System.out.println(StandardCharsets.UTF_8);
//        List<String> list = FileUtils.readLines(new File(Thread.currentThread().getClass().getResource("/").getPath() + "/positionword.json"), StandardCharsets.UTF_8);
        List<String> list = FileUtils.readLines(new File("E:\\zhaopin_doc\\日常流水\\16.txt"), StandardCharsets.UTF_8);
        System.out.println(list.size());

        for (int i = 0; i < list.size(); i++) {
            String str = list.get(i);
            String[] attrStr = str.split("\t");

            if(attrStr.length == 7){
                System.out.println(attrStr[0] + "\t" + attrStr[1] +  "\t" + attrStr[3] + "\t" + attrStr[4] + "\t" + attrStr[5] +"\t" + 1);
            }else {
                System.out.println(attrStr[0] + "\t" + attrStr[1] +  "\t" + attrStr[3] + "\t" + attrStr[4] + "\t" + attrStr[5] +"\t" + 0);
            }


//            String s = attrStr[1] + "\t" + attrStr[0] + "\t" + attrStr[3] + "\t" + attrStr[2] + "\t" + attrStr[5] + "\t" + attrStr[4] + "\t" + 1;
//            System.out.println(s);
        }
    }
}
